package fr.expdev.bndd;

import android.os.Bundle;
import android.webkit.WebView;
import fr.expdev.bndd.data.Post;
import greendroid.app.GDActivity;

public class WebPost extends GDActivity {

	/**
	 * Post a afficher
	 */
	private Post post;

	/**
	 * WebView dans laquelle on affiche l'article
	 */
	private WebView webView;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setActionBarContentView(R.layout.web_post);

		post = (Post)getIntent().getSerializableExtra("post");

		getActionBar().setTitle(post.getTitle());
		
		webView = ((WebView) findViewById(R.id.web_post_content));

		webView.getSettings().setJavaScriptEnabled(true);
		webView.loadUrl(post.getLink());
	}

}
